let HtmlWebpackPlugin = require('html-webpack-plugin')
let path = require('path')

module.exports = {
  mode: 'development',
  module: {
    rules: [
      { test: /.(js|jsx)$/, use: 'babel-loader', exclude: /node_modules/ },
      { test: /.css$/, use: ['style-loader', 'css-loader']},
      { test: /.less$/, use: ['style-loader', 'css-loader?modules', 'less-loader']},
      { test: /.(eot|woff|woff2|svg|ttf)$/, use: 'url-loader'},
      { test: /.png$/, use: 'url-loader'}
    ]
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: './src/index.html',
      filename: 'index.html'
    })
  ],
  resolve: {
    extensions: ['.js', '.jsx', '.json'],
    alias: {
      '@': path.join(__dirname, './src')
    }
  }
}